This page last changed on Dec 18, 2007 by aaime.

GeoServer logging profiles

Logging profiles are property files located in the GEOSERVER_DATA_DIR/log directory.
Each profile is in fact a Log4j configuration file, for example, PRODUCTION_LOGGING configuration is:

## This log4j configuration file needs to stay here, and is used as the default logging setup
## during data_dir upgrades and in case the chosen logging config isn't available.

log4j.rootLogger=WARN, geoserverlogfile, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{dd MMM HH:mm:ss} %p [%c{2}] - %m%n


log4j.appender.geoserverlogfile=org.apache.log4j.RollingFileAppender
# Keep three backup files.
log4j.appender.geoserverlogfile.MaxBackupIndex=3
# Pattern to output: date priority [category] - message
log4j.appender.geoserverlogfile.layout=org.apache.log4j.PatternLayout
log4j.appender.geoserverlogfile.layout.ConversionPattern=%d %p [%c{2}] - %m%n


log4j.category.org.geotools=WARN
log4j.category.org.geotools.factory=WARN
log4j.category.org.geoserver=WARN
log4j.category.org.vfny.geoserver=WARN
log4j.category.org.vfny.geoserver.config.web.tiles.definition.MultipleDefinitionsFactory=WARN
log4j.category.org.vfny.geoserver.global=WARN

log4j.category.org.springframework=WARN
log4j.category.org.apache.struts=WARN

In the file you can see configurations for a root logger, with a main logging level, two appenders (standard output and log file) and a set of logging levels for specific packages.

You can create a custom logging profile following the same rules and by inspecting the GeoServer source code if you have package specific configuration needs.
For example, if you wanted to have lots of logs out of the JDBC based datastores such as Postgis, you could
specify the following:

log4j.category.org.geotools.data.postgis=FINE
log4j.category.org.geotools.data.jdbc=FINE
log4j.category.org.geotools=WARN

Once the property file is completed just include it in the GEOSERVER_DATA_DIR/logs directory and the web UI will include it in your list.

Document generated by Confluence on Jan 16, 2008 23:27